import type { devicestartworkType,DeviceSortType,addDeviceType} from './type.ts'
// 获取设备分类列表
import request from '@/utils/request.ts'

// 设备分组
export const deviceSortFn = function(){
	return request('/spray/mini/v1/equipment/groups','GET')
}
export const addeditGroupFn = function (groupId:number,data:any) {
    return request(`/spray/mini/v1/equipment/group/${groupId}`, 'POST', data)
}
// 设备列表
export const devlceListFn = function (data:any) {
    return request('/spray/mini/v1/equipments','GET',data)
}
// 设备开始/结束工作
export const deviceWorkFn = function (data:devicestartworkType) {
    return request(`/spray/mini/v1/equipment/${data.equipmentId}/start`,'POST',data)
}
// 添加设备
export const addDeviceFn = function (data: addDeviceType) {
    return request('/spray/mini/v1/equipment/bind','POST',data)
}
// 获取天气
export const getWeatherInfo = function (data: any) {
    return request('/spray/mini/v1/user/weather','POST',data)
        // return request('/spray/mini/v1/weather','POST',data)
}

export const share = function(data:any) {
    return request('/spray/mini/v1/share', 'POST', data)
  }